/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dsw2.veterinarySystem.view;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author 100101
 */
@ManagedBean
@SessionScoped
public class AccessBean {
    
    private String user;
    private String password;

    /**
     * Creates a new instance of AccessBean
     */
    public AccessBean() {
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    
    public String procesarAction(){
        FacesContext context= FacesContext.getCurrentInstance();
        context.getExternalContext().getSessionMap().put("USUARIO_LOGUEADO",user);
        if(user.equals("veterinary")&&password.equals("1")){
        return "PrincipalMenu";
        }else{
            return "Login";
        }
    }
    
}

